package com.kate.mall.order.feign;

import com.kate.mall.common.utils.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @Description: 用一句话描述
 * @Auther: 新梦想*陈超
 * @Date: 2021/10/30 16:27
 */
@FeignClient("product-center")
public interface ProductFeignClient {
    @GetMapping("/product/goodsproduct/sale_stock_quantity/{id}")
    R getSaleStockQuantity(@PathVariable("id")Integer goodsId);

    @GetMapping("/product/goodsproduct/info/{id}")
    R getGoodsSkuById(@PathVariable("id") Integer id);

    @PutMapping("/product/goodsproduct/reduce_stock")
    int reduceStock(@RequestParam("orderId") Integer orderId, @RequestParam("id") Integer id, @RequestParam("num") Integer num);

}
